Package-level declarations

Types

Link copied to clipboard

Context for actions

Link copied to clipboard

Reusable AgentFunction. Allows use of AgentPlatform as a function from I to O, with different process options.

Link copied to clipboard

Typed operations over an agent platform

Link copied to clipboard
object AgentUtils

For use from Java

Link copied to clipboard
interface Aggregation

Tag interface to indicate that an implementing type should be built from the context from its bound fields. Provides a strongly typed way to wait on combined results. Makes a megazord! An aggregation should have multiple non-nullable fields, each of which will be bound to the blackboard. An aggregation is used as an input to the action.

Link copied to clipboard
interface Ai

Gateway to AI functionality in the context of an operation. This includes both LLM and embedding models.

Link copied to clipboard

Can be injected into components

Link copied to clipboard
interface Asyncer

Simple Java-friendly async interface.

Link copied to clipboard
typealias Embedding = FloatArray
Link copied to clipboard

OperationContext that execute actions. An ExecutingOperationContext can execute agents as sub-processes.

Link copied to clipboard

ActionContext with a single input

Link copied to clipboard

ActionContext with multiple inputs

Link copied to clipboard
interface LlmReference

An LLmReference exposes tools and is a prompt contributor. The prompt contribution might describe how to use the tools or can include relevant information directly. Consider, for example, a reference to an API which is so small it's included in the prompt, versus a large API which must be accessed via tools. The reference name is used in a strategy for tool naming, so should be fairly short. Description may be more verbose. If you want a custom naming strategy, use a ToolObject directly, and add the PromptContributor separately.

Link copied to clipboard

Try to resolve a stuck agent process by trying all handlers in order

Link copied to clipboard
class NoSuchAgentException(val agentName: String, val knownAgents: String) : IllegalArgumentException
Link copied to clipboard
interface ObjectCreator<T>

Create an object of the given type from a prompt or messages. Allows setting strongly typed examples.

Link copied to clipboard

Context for any operation. Exposes blackboard and process context.

Link copied to clipboard

User code should always use this interface to execute prompts. Typically obtained from an OperationContext or ActionContext parameter, via OperationContext.ai A PromptRunner is immutable once constructed, and has determined LLM and hyperparameters. Use the "with" methods to evolve the state to your desired configuration before executing createObject, generateText or other LLM invocation methods. Thus, a PromptRunner can be reused within an action implementation. A contextual facade to LlmOperations.

Link copied to clipboard

User-facing interface for executing prompts.

Link copied to clipboard
interface SomeOf

Tag interface used as an action return type. Indicates that some of the fields will be bound to the blackboard. Fields are usually nullable.

Link copied to clipboard
fun interface StuckHandler

Attempts to resolve stuck processes

Link copied to clipboard
class StuckHandlerResult(val message: String, val handler: StuckHandler?, val code: StuckHandlingResultCode, val agentProcess: AgentProcess) : AbstractAgentProcessEvent
Link copied to clipboard
class Subagent

Define a handoff to a subagent.

Link copied to clipboard
class SupplierActionContext<O>(val processContext: ProcessContext, val action: Action, val outputClass: Class<O>) : ActionContext, Blackboard, AgenticEventListener
Link copied to clipboard
class TemplateOperations(templateName: String, templateRenderer: <Error class: unknown class>, promptRunnerOperations: PromptRunnerOperations)

Llm operations based on a compiled template. Similar to PromptRunnerOperations, but taking a model instead of a template string. Template names will be resolved by the TemplateRenderer provided.

Link copied to clipboard
data class ToolObject(val obj: Any, val namingStrategy: StringTransformer = StringTransformer.IDENTITY, val filter: (String) -> Boolean = { true })

Holds an annotated tool object. Adds a naming strategy and a filter to the object.

Link copied to clipboard
interface ToolsStats

Tool statistics, indexed by tool name.

Link copied to clipboard
open class ToolStats(val name: String, val calls: Int, val averageResponseTime: Long = 0, val failures: Int = 0)

Stats around tool calls to a particular tool. Open to allow implementations to extend if they wish

Link copied to clipboard
fun interface Transformation<I, O>

Transformation function signature

Link copied to clipboard
data class TransformationActionContext<I, O>(val input: I, val processContext: ProcessContext, val action: Action, val inputClass: Class<I>, val outputClass: Class<O>) : InputActionContext<I> , Blackboard, AgenticEventListener
Link copied to clipboard
interface TypedOps

Enables typed operations using agentic systems

Functions

Link copied to clipboard
inline fun <I, O : Any> agentTransformer(agent: Agent): Action
fun <I, O : Any> agentTransformer(agent: Agent, pre: List<String> = emptyList(), post: List<String> = emptyList(), cost: <Error class: unknown class> = 0.0, value: <Error class: unknown class> = 0.0, canRerun: Boolean = false, inputClass: Class<I>, outputClass: Class<O>): Action
Link copied to clipboard
inline fun <I, O : Any> asAction(agentName: String): Action

fun <I, O : Any> asAction(agentName: String, inputClass: Class<I>, outputClass: Class<O>, pre: List<String> = emptyList(), post: List<String> = emptyList(), cost: <Error class: unknown class> = 0.0, value: <Error class: unknown class> = 0.0, canRerun: Boolean = false): Action

Expose the named agent as an action of the given transformation type

Link copied to clipboard
inline fun <I, O : Any> Agent.asAction(): Action

Expose this agent as an action of the given transformation type

Link copied to clipboard
inline fun <I : Any, O> TypedOps.asFunction(): AgentFunction<I, O>
Link copied to clipboard
inline fun <O : Any> ActionContext.asSubProcess(agentScopeBuilder: AgentScopeBuilder<O>): O
inline fun <O : Any> ActionContext.asSubProcess(agent: Agent): O

Run the given agent as a sub-process of this action context.

Link copied to clipboard
fun <I, O : Any> asTransformation(agent: Agent, outputClass: Class<O>): Transformation<I, O>
Link copied to clipboard
inline fun <I, O : Any> Agent.asTransformation(): Transformation<I, O>

Creates a transformation action from an agent

Link copied to clipboard
infix inline fun <T> PromptRunner.create(prompt: String): T

Create an object of the given type. Method overloading is evil

Link copied to clipboard
infix inline fun <T> PromptRunner.createObject(prompt: String): T

Create an object of the given type

inline fun <T> TemplateOperations.createObject(model: Map<String, Any>): T
Link copied to clipboard
inline fun <T> PromptRunner.createObjectIfPossible(prompt: String): T?
Link copied to clipboard
inline fun <O> TypedOps.handleUserInput(intent: String, processOptions: ProcessOptions = ProcessOptions()): O

Turn user input into this type

Link copied to clipboard
inline fun <I : Any, O : Any> TypedOps.transform(input: I, processOptions: ProcessOptions = ProcessOptions()): O

Perform the magic trick of getting from A to B

fun <I : Any, O : Any> TypedOps.transform(input: I, processOptions: ProcessOptions = ProcessOptions(), outputClass: Class<O>): O